import {ClassType} from '../../type';


/**
 * Bean factory
 * @author Zhang
 * @date 2019/3/19 9:56
 */
export interface BeanFactory {

  /**
   * 根据名称获取Bean实例
   * @param name
   * @throws BeanError
   */
  getBean(name: string): any;

  /**
   * 根据Bean类型获取实例
   * @param requiredType bean class type
   * @throws BeanError
   */
  getBean<T>(requiredType: ClassType<T>): T;

  /**
   * 判断是否存在指定名称实例
   * @param name bean name
   */
  containsBean(name: string): boolean;
}
